'use strict';
app.controller('chainCtrl',['$scope','$cookies','utilService','chainService',function($scope,$cookies,utilService,chainService){
    //根据套餐id查找套餐信息
    $scope.querySetMeal=function(){
        utilService.get({
            url:$scope.app.domain+'set/meal/info/'+$scope.chain.setMealId
        }).then(
            function(res){
                $scope.setMeal=res.data.data;
            }
        );
    }
    //根据行业id查找行业信息
    $scope.queryIndustry=function(){
        utilService.get({
            url:$scope.app.domain+'industry/'+$scope.chain.industryId
        }).then(
            function(res){
                $scope.industry=res.data.data;
            }
        );
    }
    $scope.query=function(){
        utilService.get({
            url:$scope.app.domain+'chain/session'
        }).then(
            function(res){
                $scope.chain=res.data.data;
                $scope.querySetMeal();
                $scope.queryIndustry();
            }
        );
    }
    $scope.query();
}])